import request from "@/utils/request"
import apiConfig from "@/utils/apiConfig"
const { newsList, newsAdd, newsUpdate,newsArticalInfo,delNewsItem } = apiConfig.api
export default class News {
    static getNewsList(apiData = {}) {
        return request(newsList, apiData, 'post').then((result) => {
            return result.data || {}
        })
    };
    static addNewsArtical(apiData = {}) {
        return request(newsAdd, apiData, 'post').then((result) => {
            return result.data || {}
        })
    }
    static updateNewsArtical(id,apiData = {}) {
        apiData.id=id
        return request(newsUpdate, apiData, 'post').then((result) => {
            return result.data || {}
        })
    }
    static getNewsArticleInfo(id,apiData = {}) {
        return request(`${newsArticalInfo}/${id}`, apiData, 'get').then((result) => {
            return result.data || {}
        })
    }
    static delNewsItem(apiData={}){
        return request(`${delNewsItem}`, apiData, 'delete').then((result) => {
            return result.data || {}
        }) 
    }
}